using System;
using System.Collections;
using System.Collections.Specialized;
using System.Data;
using System.Data.SqlTypes;
using System.Data.SqlClient;
using System.Text;
using ECommerce.DAL;


namespace Entity
{
	/// <summary>
	/// This object represents the Private Fields of TblShipmentCost.
	/// </summary>
	
	[System.ComponentModel.DataObject]
    public class TblShipmentCost : DatabaseUtility
    {
		#region TblShipmentCost Private Fields


		Int32 _shipmentCostId;
		Decimal _weightRangeFrom;
		Decimal _weightRangeTo;
		String _weightUnit = String.Empty;
		Decimal _shippingCostGround;
		Decimal _shippingCostStandard;
		Decimal _shippingCostExpress;
		Decimal _shippingCostOvernight;
		Boolean _isActive;
		Boolean _isDeleted;
		DateTime _createDate;
		Boolean _isPercentange;
		
		#endregion
		#region TblShipmentCost Constractor
		/// <summary>
        /// Creates an empty object of TblShipmentCost. 
        /// This is mainly used to create a new instance of TblShipmentCost to add a new TblShipmentCost.
        /// </summary>
		public TblShipmentCost(){}
		
				
		/// <summary>
        /// Used to retrieve employee information from database, 
        /// which is also used by Update method to save information of an existing TblShipmentCost.
        /// </summary>
		public TblShipmentCost
		(
			Int32 shipmentCostId,
			Decimal weightRangeFrom,
			Decimal weightRangeTo,
			String weightUnit,
			Decimal shippingCostGround,
			Decimal shippingCostStandard,
			Decimal shippingCostExpress,
			Decimal shippingCostOvernight,
			Boolean isActive,
			Boolean isDeleted,
			DateTime createDate,
			Boolean isPercentange
		)
		{
			_shipmentCostId = shipmentCostId;	
			_weightRangeFrom = weightRangeFrom;	
			_weightRangeTo = weightRangeTo;	
			_weightUnit = weightUnit;	
			_shippingCostGround = shippingCostGround;	
			_shippingCostStandard = shippingCostStandard;	
			_shippingCostExpress = shippingCostExpress;	
			_shippingCostOvernight = shippingCostOvernight;	
			_isActive = isActive;	
			_isDeleted = isDeleted;	
			_createDate = createDate;	
			_isPercentange = isPercentange;	
		}
		
		#endregion
		#region TblShipmentCost Properties
		
		 /***********************************************************************************************
                                    -- PROPERTIES --        
         Contains all the properties representing the data fields of the current entity.
         ***********************************************************************************************/

        /// <summary>
        /// This is the Primary key value of the ShipmentCostId, which can't be assigned from the application,
        /// to ensure the data consistancy, by not letting the user to change the PK_TblShipmentCost to update the data of an another TblShipmentCost instance.
        /// For view or updation purpose, every TblShipmentCost will be retrieved thru the proper 'Get' method.
        /// </summary>
		
		public Int32 ShipmentCostId
		{
			get {return _shipmentCostId;}	
		}
		
				
		public Decimal WeightRangeFrom
		{
			get {return _weightRangeFrom;}
			set {_weightRangeFrom = value;}
		}

		public Decimal WeightRangeTo
		{
			get {return _weightRangeTo;}
			set {_weightRangeTo = value;}
		}

		public String WeightUnit
		{
			get {return _weightUnit;}
			set {_weightUnit = value;}
		}

		public Decimal ShippingCostGround
		{
			get {return _shippingCostGround;}
			set {_shippingCostGround = value;}
		}

		public Decimal ShippingCostStandard
		{
			get {return _shippingCostStandard;}
			set {_shippingCostStandard = value;}
		}

		public Decimal ShippingCostExpress
		{
			get {return _shippingCostExpress;}
			set {_shippingCostExpress = value;}
		}

		public Decimal ShippingCostOvernight
		{
			get {return _shippingCostOvernight;}
			set {_shippingCostOvernight = value;}
		}

		public Boolean IsActive
		{
			get {return _isActive;}
			set {_isActive = value;}
		}

		public Boolean IsDeleted
		{
			get {return _isDeleted;}
			set {_isDeleted = value;}
		}

		public DateTime CreateDate
		{
			get {return _createDate;}
			set {_createDate = value;}
		}

		public Boolean IsPercentange
		{
			get {return _isPercentange;}
			set {_isPercentange = value;}
		}
		

		#endregion
		#region TblShipmentCost Static Methods
		/************************************************************************************
                                    -- CREATE METHOD (STATIC) --
        *************************************************************************************/
		/************************* Architecure note:**********************************
        Note 1:
        This method is specially useful for the case, where we need to use Object Data Source controls.
        For ObjectDataSource/SqlDataSource controls, the insert/update metnod requires paramters methods, rather property based methods.
        However, there is still a way to pass property based objects as method parameter for data source controls, 
        but in that case we could not use Sql type, as view controls or asp parameter control can only contain few of primitive type.
        The main reason to remain the Sql Type in our object architecture is it is faster and contains better way for null value support.
        
        Note 2: 
        Non-primary key: it should be primitive type, as the asp paramter control (included in data source control) supports only primitive types.
        /*****************************************************************************/
		[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Insert, true)]
        public static  Int32 CreateNewTblShipmentCost
		(
			Decimal weightRangeFrom,
			Decimal weightRangeTo,
			String weightUnit,
			Decimal shippingCostGround,
			Decimal shippingCostStandard,
			Decimal shippingCostExpress,
			Decimal shippingCostOvernight,
			Boolean isActive,
			Boolean isDeleted,
			DateTime createDate,
			Boolean isPercentange
		)
		{
			//creating an empty TblShipmentCost object
            TblShipmentCost tblShipmentCost = new TblShipmentCost();
				tblShipmentCost.WeightRangeFrom = weightRangeFrom;
				tblShipmentCost.WeightRangeTo = weightRangeTo;
				tblShipmentCost.WeightUnit = weightUnit;
				tblShipmentCost.ShippingCostGround = shippingCostGround;
				tblShipmentCost.ShippingCostStandard = shippingCostStandard;
				tblShipmentCost.ShippingCostExpress = shippingCostExpress;
				tblShipmentCost.ShippingCostOvernight = shippingCostOvernight;
				tblShipmentCost.IsActive = isActive;
				tblShipmentCost.IsDeleted = isDeleted;
				tblShipmentCost.CreateDate = createDate;
				tblShipmentCost.IsPercentange = isPercentange;
			
			return TblShipmentCost.CreateNewTblShipmentCost(tblShipmentCost);
		}
	
		/************************************************************************************
                 -- UPDATE METHODS (STATIC) --
        *************************************************************************************/

        /************************* Architecure note:**********************************
        Note 1:
        This method is specially useful for the case, where we need to use Object Data Source controls.
        For ObjectDataSource/SqlDataSource controls, the insert/update metnod requires paramters methods, rather property based methods.
        However, there is still a way to pass property based objects as method parameter for data source controls, 
        but in that case we could not use Sql type, as view controls or asp parameter control can only contain few of primitive type.
        The main reason to remain the Sql Type in our object architecture is it is faster and contains better way for null value support.
        
        Note 2: 
        There the two types of paramaters will be passed here.
         * a. Primary key paramater: it should be Sql type, as we will bind the primary key property for the view controls (form view, details view etc) as datakey.
         * b. Non-primary key: it should be primitive type, as the asp paramter control (included in data source control) supports only primitive types.
        /*****************************************************************************/
		
		[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Update, true)]
        public static  bool UpdateTblShipmentCost
		(
			Int32 shipmentCostId,
			Decimal weightRangeFrom,
			Decimal weightRangeTo,
			String weightUnit,
			Decimal shippingCostGround,
			Decimal shippingCostStandard,
			Decimal shippingCostExpress,
			Decimal shippingCostOvernight,
			Boolean isActive,
			Boolean isDeleted,
			DateTime createDate,
			Boolean isPercentange
		)
		{
			 TblShipmentCost tblShipmentCost =  TblShipmentCost.GetTblShipmentCostByShipmentCostId(shipmentCostId);
			
				tblShipmentCost.WeightRangeFrom = weightRangeFrom;
				tblShipmentCost.WeightRangeTo = weightRangeTo;
				tblShipmentCost.WeightUnit = weightUnit;
				tblShipmentCost.ShippingCostGround = shippingCostGround;
				tblShipmentCost.ShippingCostStandard = shippingCostStandard;
				tblShipmentCost.ShippingCostExpress = shippingCostExpress;
				tblShipmentCost.ShippingCostOvernight = shippingCostOvernight;
				tblShipmentCost.IsActive = isActive;
				tblShipmentCost.IsDeleted = isDeleted;
				tblShipmentCost.CreateDate = createDate;
				tblShipmentCost.IsPercentange = isPercentange;
			
			return TblShipmentCost.UpdateTblShipmentCost(tblShipmentCost);
		}

		/************************************************************************************
                         -- DELETE METHODS --
        *************************************************************************************/
        /************************* Architecure note:**********************************
        We have used the employeeId parameter as SqlInt32, to bind the delete method with object data source and view control directly.
        ****************************************************************************/
		[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Update, true)]
        public static  bool DeleteTblShipmentCost
		(
			Int32 shipmentCostId
		)
		{
			//Validate Input
			if(shipmentCostId <= GetShipmentCostIdMinValue)
				throw (new ArgumentOutOfRangeException("shipmentCostId"));
				
			// Execute SQL Command
            SqlCommand sqlCmd = new SqlCommand();
			AddParameterToSqlCmd(sqlCmd, "@ReturnValue", SqlDbType.Int, 0, ParameterDirection.ReturnValue, null);
			AddParameterToSqlCmd(sqlCmd, "@ShipmentCostId",SqlDbType.Int, 0, ParameterDirection.Input, shipmentCostId);
			SetCommandType(sqlCmd,CommandType.StoredProcedure,SPR_TBLSHIPMENTCOST_DELETETBLSHIPMENTCOST);
			ExecuteScalarCmd(sqlCmd);
			int returnValue = (int)sqlCmd.Parameters["@ReturnValue"].Value;
			return (returnValue == 0 ? false : true);
			
		}
		
		/// <summary>
        /// Deletes a set of employees from the database.
        /// </summary>
		public static bool DeleteTblShipmentCostList( System.Collections.Generic.List<Int32>  shipmentCostIdListToDelete)
		{
			//Validate Input
			foreach (Int32 shipmentCostId in shipmentCostIdListToDelete)
			    if(shipmentCostId <= GetShipmentCostIdMinValue)
					throw (new ArgumentOutOfRangeException("shipmentCostId"));
			
			//performing deletion operation //

            string xmlString = FormatXMLForIdArray(shipmentCostIdListToDelete);
			
			// Execute SQL Command
            SqlCommand sqlCmd = new SqlCommand();
			AddParameterToSqlCmd(sqlCmd, "@ReturnValue", SqlDbType.Int, 0, ParameterDirection.ReturnValue, null);
            AddParameterToSqlCmd(sqlCmd, "@ShipmentCostIdList", SqlDbType.Xml, xmlString.ToString().Length, ParameterDirection.Input, xmlString.ToString());
			SetCommandType(sqlCmd,CommandType.StoredProcedure,SPR_TBLSHIPMENTCOST_DELETETBLSHIPMENTCOSTLIST);
			ExecuteScalarCmd(sqlCmd);
			int returnValue = (int)sqlCmd.Parameters["@ReturnValue"].Value;
			return (returnValue == shipmentCostIdListToDelete.Count ? true : false);
		}
		
		/************************************************************************************
                                 -- GET BY PRIMARY METHODS --
        *************************************************************************************/
        /************************* Architecure note:**********************************
        Retrives an Employee from database, based on it's primary key.
        To view or update an employee, everytime we must have to use this type of 'get' method, 
        since we don't have direct access to the Primary key value for assigning value.
        We have used the employeeId parameter as SqlInt32, to bind the delete method with object data source and view control directly.
        /*****************************************************************************/
		[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]
		public static TblShipmentCost GetTblShipmentCostByShipmentCostId(Int32 shipmentCostId)
		{
			if(shipmentCostId <= GetShipmentCostIdMinValue)
					throw (new ArgumentOutOfRangeException("shipmentCostId"));
				
		 	// Execute SQL Command
			SqlCommand sqlCmd = new SqlCommand();
			AddParameterToSqlCmd(sqlCmd, "@ShipmentCostId",SqlDbType.Int, 0, ParameterDirection.Input, shipmentCostId);
			SetCommandType(sqlCmd,CommandType.StoredProcedure,SPR_TBLSHIPMENTCOST_GETTBLSHIPMENTCOSTBYSHIPMENTCOSTID);
			GenerateCollectionFromReader test = new GenerateCollectionFromReader(GenerateTblShipmentCostCollectionFromReader);
            CustomCollection<TblShipmentCost> objCollection = ((CustomCollection<TblShipmentCost>)ExecuteReaderCmd(sqlCmd, test));

            if (objCollection.Count > 0)
                return objCollection[0];
            else
                return null;
		}
		
		/************************************************************************************
                         -- GET BY FOREIGN KEY METHODS --
        *************************************************************************************/
		
		/************************************************************************************
                 -- GET ALL METHODS --
        *************************************************************************************/
		[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]
        public static CustomCollection<TblShipmentCost> GetAllTblShipmentCost()
		{
		
		 	// Execute SQL Command
            SqlCommand sqlCmd = new SqlCommand();
            SetCommandType(sqlCmd,CommandType.StoredProcedure,SPR_TBLSHIPMENTCOST_GETALLTBLSHIPMENTCOST);
            GenerateCollectionFromReader test = new GenerateCollectionFromReader(GenerateTblShipmentCostCollectionFromReader);
            CustomCollection<TblShipmentCost> objCollection = ((CustomCollection<TblShipmentCost>)ExecuteReaderCmd(sqlCmd, test));

            return objCollection;
		}
		
		[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]
        public static CustomCollection<TblShipmentCost> GetAllTblShipmentCostPaged(String orderBy, Int32 startRowIndex, Int32 maximumRows)
        {
            //Validate Input
            if (orderBy == "")
                orderBy = "ShipmentCostId";

            // Execute SQL Command
            SqlCommand sqlCmd = new SqlCommand();
            AddParameterToSqlCmd(sqlCmd, "@orderby", SqlDbType.VarChar, 50, ParameterDirection.Input, orderBy);
            AddParameterToSqlCmd(sqlCmd, "@startrow", SqlDbType.Int, 0, ParameterDirection.Input, startRowIndex);
            AddParameterToSqlCmd(sqlCmd, "@pagesize", SqlDbType.Int, 0, ParameterDirection.Input, maximumRows);

            SetCommandType(sqlCmd,CommandType.StoredProcedure,SPR_TBLSHIPMENTCOST_GETALLTBLSHIPMENTCOSTPAGED);

            GenerateCollectionFromReader test = new GenerateCollectionFromReader(GenerateTblShipmentCostCollectionFromReader);
            CustomCollection<TblShipmentCost> objCollection = ((CustomCollection<TblShipmentCost>)ExecuteReaderCmd(sqlCmd, test));
            return objCollection;
        }
		
		[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]
        public static int GetAllTblShipmentCostPagedCount(String orderBy, Int32 startRowIndex, Int32 maximumRows)
        {
            // Execute SQL Command
            SqlCommand sqlCmd = new SqlCommand();

            AddParameterToSqlCmd(sqlCmd, "@ReturnValue", SqlDbType.Int, 0, ParameterDirection.ReturnValue, null);
            SetCommandType(sqlCmd,CommandType.StoredProcedure,SPR_TBLSHIPMENTCOST_GETALLTBLSHIPMENTCOSTPAGEDCOUNT);
            ExecuteScalarCmd(sqlCmd);

            int returnValue = (int)sqlCmd.Parameters["@ReturnValue"].Value;
            return returnValue;
        }
		
		#endregion
		#region Employee Instance Methods
		/************************************************************************************
                                    -- SAVE (INSERT/UPDATE) METHODS (INSTANCE) --
        *************************************************************************************/
		/// <summary>
        /// Saves (inserts and updates) an Employee into database.
        /// The insertion occur if the EmployeeId conatins default value.
        /// Otherwises it updates the Employee into the database, based on the primary key value stored in EmployeeId.
        /// This technique ensures an Employee will not be updated without having a valid EmployeeId.
        /// </summary>
		public bool Save()
		{
			if(ShipmentCostId<= GetShipmentCostIdMinValue)
			{
				Int32 TempId=CreateNewTblShipmentCost(this);
				if(TempId>0)
				{
					_shipmentCostId=TempId;
					return true;
				}
				else
				{
					// error occurs
					return false;
				}
			}
			else
			{	//This is a update Command
				return (UpdateTblShipmentCost(this));
			}
			
		}
		
		public static Int32 CreateNewTblShipmentCost(TblShipmentCost newTblShipmentCost)
		{
			// validate Parameters
			if (newTblShipmentCost == null)
				throw (new ArgumentNullException("newTblShipmentCost"));

			// Execute SQL Command
			SqlCommand sqlCmd = new SqlCommand();
			int length = 0;
			AddParameterToSqlCmd(sqlCmd, "@ReturnValue", SqlDbType.Int, 0, ParameterDirection.ReturnValue, null);
            
			AddParameterToSqlCmd(sqlCmd, "@WeightRangeFrom",SqlDbType.Decimal, 9, ParameterDirection.Input, newTblShipmentCost.WeightRangeFrom);
			AddParameterToSqlCmd(sqlCmd, "@WeightRangeTo",SqlDbType.Decimal, 9, ParameterDirection.Input, newTblShipmentCost.WeightRangeTo);
			AddParameterToSqlCmd(sqlCmd, "@WeightUnit",SqlDbType.NVarChar, 50, ParameterDirection.Input, newTblShipmentCost.WeightUnit);
			AddParameterToSqlCmd(sqlCmd, "@ShippingCostGround",SqlDbType.Decimal, 9, ParameterDirection.Input, newTblShipmentCost.ShippingCostGround);
			AddParameterToSqlCmd(sqlCmd, "@ShippingCostStandard",SqlDbType.Decimal, 9, ParameterDirection.Input, newTblShipmentCost.ShippingCostStandard);
			AddParameterToSqlCmd(sqlCmd, "@ShippingCostExpress",SqlDbType.Decimal, 9, ParameterDirection.Input, newTblShipmentCost.ShippingCostExpress);
			AddParameterToSqlCmd(sqlCmd, "@ShippingCostOvernight",SqlDbType.Decimal, 9, ParameterDirection.Input, newTblShipmentCost.ShippingCostOvernight);
			AddParameterToSqlCmd(sqlCmd, "@IsActive",SqlDbType.Bit, 0, ParameterDirection.Input, newTblShipmentCost.IsActive);
			AddParameterToSqlCmd(sqlCmd, "@IsDeleted",SqlDbType.Bit, 0, ParameterDirection.Input, newTblShipmentCost.IsDeleted);
			AddParameterToSqlCmd(sqlCmd, "@CreateDate",SqlDbType.DateTime, 0, ParameterDirection.Input, newTblShipmentCost.CreateDate);
			AddParameterToSqlCmd(sqlCmd, "@IsPercentange",SqlDbType.Bit, 0, ParameterDirection.Input, newTblShipmentCost.IsPercentange);
			
			SetCommandType(sqlCmd,CommandType.StoredProcedure,SPR_TBLSHIPMENTCOST_CREATENEWTBLSHIPMENTCOST);
			ExecuteScalarCmd(sqlCmd);
			return (Int32.Parse(sqlCmd.Parameters["@ReturnValue"].Value.ToString()));

		}
		/// <summary>
        /// Updates an TblShipmentCost instance to the database.
        /// </summary>
		public static bool UpdateTblShipmentCost(TblShipmentCost newTblShipmentCost)
		{
			// validate Parameters
			if (newTblShipmentCost == null)
				throw (new ArgumentNullException("newTblShipmentCost"));

			// Execute SQL Command
			SqlCommand sqlCmd = new SqlCommand();
			int length = 0;
			AddParameterToSqlCmd(sqlCmd, "@ReturnValue", SqlDbType.Int, 0, ParameterDirection.ReturnValue, null);
            
			AddParameterToSqlCmd(sqlCmd, "@ShipmentCostId",SqlDbType.Int, 0, ParameterDirection.Input, newTblShipmentCost.ShipmentCostId);
			AddParameterToSqlCmd(sqlCmd, "@WeightRangeFrom",SqlDbType.Decimal, 9, ParameterDirection.Input, newTblShipmentCost.WeightRangeFrom);
			AddParameterToSqlCmd(sqlCmd, "@WeightRangeTo",SqlDbType.Decimal, 9, ParameterDirection.Input, newTblShipmentCost.WeightRangeTo);
			AddParameterToSqlCmd(sqlCmd, "@WeightUnit",SqlDbType.NVarChar, 50, ParameterDirection.Input, newTblShipmentCost.WeightUnit);
			AddParameterToSqlCmd(sqlCmd, "@ShippingCostGround",SqlDbType.Decimal, 9, ParameterDirection.Input, newTblShipmentCost.ShippingCostGround);
			AddParameterToSqlCmd(sqlCmd, "@ShippingCostStandard",SqlDbType.Decimal, 9, ParameterDirection.Input, newTblShipmentCost.ShippingCostStandard);
			AddParameterToSqlCmd(sqlCmd, "@ShippingCostExpress",SqlDbType.Decimal, 9, ParameterDirection.Input, newTblShipmentCost.ShippingCostExpress);
			AddParameterToSqlCmd(sqlCmd, "@ShippingCostOvernight",SqlDbType.Decimal, 9, ParameterDirection.Input, newTblShipmentCost.ShippingCostOvernight);
			AddParameterToSqlCmd(sqlCmd, "@IsActive",SqlDbType.Bit, 0, ParameterDirection.Input, newTblShipmentCost.IsActive);
			AddParameterToSqlCmd(sqlCmd, "@IsDeleted",SqlDbType.Bit, 0, ParameterDirection.Input, newTblShipmentCost.IsDeleted);
			AddParameterToSqlCmd(sqlCmd, "@CreateDate",SqlDbType.DateTime, 0, ParameterDirection.Input, newTblShipmentCost.CreateDate);
			AddParameterToSqlCmd(sqlCmd, "@IsPercentange",SqlDbType.Bit, 0, ParameterDirection.Input, newTblShipmentCost.IsPercentange);
			
			SetCommandType(sqlCmd,CommandType.StoredProcedure,SPR_TBLSHIPMENTCOST_UPDATETBLSHIPMENTCOST);
            ExecuteScalarCmd(sqlCmd);
			int returnValue = (int)sqlCmd.Parameters["@ReturnValue"].Value;
			return (returnValue == 0 ? false : true);
		}
		#endregion
		
		#region TblShipmentCost Related Collections
		/// <summary>
        /// Creates and returns a strongly typed collection of Employee custom entity. 
        /// The colelction is created through iterating on the IdataReader object which contains Employee information, as a set of records, similar to tabular format.
        /// </summary>
		public static CollectionBase  GenerateTblShipmentCostCollectionFromReader(IDataReader returnData) 
		{
			
			//creating the instance of Employee collection
			CustomCollection<TblShipmentCost> colTblShipmentCost = new CustomCollection<TblShipmentCost>();
			
			/************************* Architecure note:**********************************
             * Below code includes the null value functionality to retieve the data which has nill value in database end.
             * Design consideration:
             * Besides general data fields, special care should be taken for primary keys, to assign '0'/defaultvalue, rather passing 'Null' value in constructor parameter.
             * Although we are considering sqldb tyoe data for the current data container, but while retireving data from database end, through datareader object, we need to cast data reader objects using .net primitive data type, 
             * rather using sqldb type to cast, since data reader objects don't support sql db type to be casted.
             *****************************************************************************/

            //Iterating thriugh the data reader, to generate Employee collection.

			//getting the Employee collection by iterating thru the data reader
			while (returnData.Read()) 
			{
				//passing the TblShipmentCost constructor parameters from the current instance of data reader fields.
				TblShipmentCost newTblShipmentCost = new TblShipmentCost
				(
					returnData["ShipmentCostId"]== System.DBNull.Value ? GetShipmentCostIdMinValue : (Int32 ) returnData["ShipmentCostId"],
					returnData["WeightRangeFrom"]== System.DBNull.Value ? 0: (Decimal ) returnData["WeightRangeFrom"],
					returnData["WeightRangeTo"]== System.DBNull.Value ? 0: (Decimal ) returnData["WeightRangeTo"],
					returnData["WeightUnit"]== System.DBNull.Value ? string.Empty: (String ) returnData["WeightUnit"],
					returnData["ShippingCostGround"]== System.DBNull.Value ? 0: (Decimal ) returnData["ShippingCostGround"],
					returnData["ShippingCostStandard"]== System.DBNull.Value ? 0: (Decimal ) returnData["ShippingCostStandard"],
					returnData["ShippingCostExpress"]== System.DBNull.Value ? 0: (Decimal ) returnData["ShippingCostExpress"],
					returnData["ShippingCostOvernight"]== System.DBNull.Value ? 0: (Decimal ) returnData["ShippingCostOvernight"],
					returnData["IsActive"]== System.DBNull.Value ? false: (Boolean ) returnData["IsActive"],
					returnData["IsDeleted"]== System.DBNull.Value ? false: (Boolean ) returnData["IsDeleted"],
					returnData["CreateDate"]== System.DBNull.Value ? DateTime.MinValue: (DateTime ) returnData["CreateDate"],
					returnData["IsPercentange"]== System.DBNull.Value ? false: (Boolean ) returnData["IsPercentange"]

				);
				//adding the Employee to the collection
				colTblShipmentCost.Add(newTblShipmentCost);
			}
			
			//returns the collection of Companys 
			return (colTblShipmentCost);
		}
		
		#endregion
		#region Constants and Default Values
		
		public static Int32 GetShipmentCostIdMinValue
		{
			get
			{
				return 0;
			}
		}
		
		//create method related contants
			internal const string SPR_TBLSHIPMENTCOST_CREATENEWTBLSHIPMENTCOST="spr_TblShipmentCost_CreateNewTblShipmentCost";
			internal const string SPR_TBLSHIPMENTCOST_UPDATETBLSHIPMENTCOST="spr_TblShipmentCost_UpdateTblShipmentCost";
			internal const string SPR_TBLSHIPMENTCOST_DELETETBLSHIPMENTCOST="spr_TblShipmentCost_DeleteTblShipmentCost";
			internal const string SPR_TBLSHIPMENTCOST_DELETETBLSHIPMENTCOSTLIST="spr_TblShipmentCost_DeleteTblShipmentCostList";
			internal const string SPR_TBLSHIPMENTCOST_GETTBLSHIPMENTCOSTBYSHIPMENTCOSTID="spr_TblShipmentCost_GetTblShipmentCostByShipmentCostId";
			internal const string SPR_TBLSHIPMENTCOST_GETALLTBLSHIPMENTCOST="spr_TblShipmentCost_GetAllTblShipmentCost";
			internal const string SPR_TBLSHIPMENTCOST_GETALLTBLSHIPMENTCOSTPAGED="spr_TblShipmentCost_GetAllTblShipmentCostPaged";
			internal const string SPR_TBLSHIPMENTCOST_GETALLTBLSHIPMENTCOSTPAGEDCOUNT="spr_TblShipmentCost_GetAllTblShipmentCostPagedCount";
		
		#endregion
	}
}	
